(function(app){
	app
	.directive('hideTabs', function($rootScope) {
		//alert("***");
	    return {
	        restrict: 'A',
	        link: function(scope, element, attributes) {
	            scope.$on('$ionicView.beforeEnter', function() {
	                scope.$watch(attributes.hideTabs, function(value){
	                    $rootScope.hideTabs = value;
	                });
	            });
	            scope.$on('$ionicView.beforeLeave', function() {
	                $rootScope.hideTabs = false;
	            });
	        }
	    };
	});
//抄袭的	https://github.com/ionic-team/ionic-framework/issues/1503
	app.directive('bindHtmlCompile', ['$compile', function ($compile) {
		  return {
		    restrict: 'A',
		    link: function (scope, element, attrs) {
		      scope.$watch(function () {
		        return scope.$eval(attrs.bindHtmlCompile);
		      }, function (value) {
		        // Incase value is a TrustedValueHolderType, sometimes it
		        // needs to be explicitly called into a string in order to
		        // get the HTML string.
		        element.html(value && value.toString());
		        // If scope is provided use it, otherwise use parent scope
		        var compileScope = scope;
		        if (attrs.bindHtmlScope) {
		          compileScope = scope.$eval(attrs.bindHtmlScope);
		        }
		        $compile(element.contents())(compileScope);
		      });
		    }
		  };
		}]);
})(app)
